package traceMyItems.server;
import java.util.logging.Logger;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;






import traceMyItems.business.TraceMyItems;
import traceMyItems.business.User;

public class SearchItems extends HttpServlet{ 
  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final Logger log = Logger.getLogger(SearchItems.class.getName());
	
public void doGet(HttpServletRequest request, 
  HttpServletResponse response)
  throws ServletException,IOException{
  
	
	log.info("Pedido de SEARCH_ITEMS recibido (GET)");
			
    	
	
	try
	{
		
				    	
	    		    
	}
	catch(Exception ex)
	{				
	
	}
	
	
  }

public void doPost(HttpServletRequest request, 
		  HttpServletResponse response)
		  throws ServletException,IOException
		  {
			String strJsonResponse = "";
			response.setContentType("text/x-json;charset=UTF-8");           
		    response.setHeader("Cache-Control", "no-cache");
		    
			log.info("Pedido de SEARCH_ITEMS recibido (POST)");
					
		    	
			TraceMyItems objManager = TraceMyItems.getInstance();			
			
			try
			{
				
				response.getWriter().write(objManager.verMisIncidencias());
				
				response.getWriter().write("{" +
						"\"page\": \"1\"," +
						"\"records\": \"100\"," +
						"\"total\": \"1\"," +
						"\"rows\": [" +
						" {" +
						"\"id\": 3, " +
						"\"cell\": [" +
						"3," +
						"\"cell 1\"," +
						"\"2010-09-29T19:05:32\"," +
						"\"2010-09-29T20:15:56\" " +
						" ]" +
						"}" +
						"]" +					
						
						"}");	
						    	
			    		    
			}
			catch(Exception ex)
			{				
				log.warning("Excepcion buscando items del usuario: "+ex.getMessage());
				response.getWriter().write("");
		   
			}
			
		  }

}